import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../../views/Login.vue'
import Home from '../../views/Home.vue'

Vue.use(VueRouter)

const requireAuth = true
const showLayout = true
export default [
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {requireAuth: false, showLayout: false}
  },
  {
    path: '/',
    name: 'home',
    component: Home,
    meta: {requireAuth, showLayout}
  },
  {
    path: '/notice/add',
    name: 'noticeAdd',
    component: () =>
      import(/* webpackChunkName: "notice" */ '../../views/Notice/NoticeAdd.vue'),
    meta: {requireAuth, showLayout, activeName: 'noticeSendList'}
  },
  {
    path: '/notice/list',
    name: 'noticeList',
    component: () =>
      import(/* webpackChunkName: "notice" */ '../../views/Notice/NoticeList.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/notice/send',
    name: 'noticeSendList',
    component: () =>
      import(/* webpackChunkName: "notice" */ '../../views/Notice/NoticeSendList.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/notice/detail/:id',
    name: 'noticeDetail',
    component: () =>
      import(/* webpackChunkName: "notice" */ '../../views/Notice/NoticeDetail.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/bulletin/add',
    name: 'bulletinAdd',
    component: () =>
      import(/* webpackChunkName: "bulletin" */ '../../views/Bulletin/BulletinAdd.vue'),
    meta: {requireAuth, showLayout, activeName: 'bulletinSendList'}
  },
  {
    path: '/bulletin/list',
    name: 'bulletinList',
    component: () =>
      import(/* webpackChunkName: "bulletin" */ '../../views/Bulletin/BulletinList.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/bulletin/send',
    name: 'bulletinSendList',
    component: () =>
      import(
        /* webpackChunkName: "bulletin" */ '../../views/Bulletin/BulletinSendList.vue'
      ),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/bulletin/detail/:id',
    name: 'bulletinDetail',
    component: () =>
      import(
        /* webpackChunkName: "bulletin" */ '../../views/Bulletin/BulletinDetail.vue'
      ),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/message/add',
    name: 'messageAdd',
    component: () =>
      import(/* webpackChunkName: "message" */ '../../views/Message/MessageAdd.vue'),
    meta: {requireAuth, showLayout, activeName: 'messageSendList'}
  },
  {
    path: '/message/list',
    name: 'messageList',
    component: () =>
      import(/* webpackChunkName: "message" */ '../../views/Message/MessageList.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/message/send',
    name: 'messageSendList',
    component: () =>
      import(
        /* webpackChunkName: "message" */ '../../views/Message/MessageSendList.vue'
      ),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/message/detail/:id',
    name: 'messageDetail',
    component: () =>
      import(/* webpackChunkName: "message" */ '../../views/Message/MessageDetail.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/learning/list',
    name: 'learningList',
    component: () =>
      import(
        /* webpackChunkName: "learning" */ '../../views/Learning/LearningList.vue'
      ),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/learning/send',
    name: 'learningSendList',
    component: () =>
      import(
        /* webpackChunkName: "learning" */ '../../views/Learning/LearningSendList.vue'
      ),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/committee',
    name: 'committee',
    component: () =>
      import(/* webpackChunkName: "committee" */ '../../views/Committee/Committee.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/committee/detail/:id',
    name: 'committeeDetail',
    component: () =>
      import(/* webpackChunkName: "committee" */ '../../views/Committee/CommitteeDetail.vue'),
    meta: {requireAuth, showLayout, activeName: 'committee'}
  },
  {
    path: '/committeeAddEdit/:id?',
    name: 'committeeAddEdit',
    alias: ['/committee/add', '/committee/edit/:id'],
    component: () =>
      import(
        /* webpackChunkName: "committee" */ '../../views/Committee/CommitteeAddEdit.vue'
      ),
    meta: {requireAuth, showLayout, activeName: 'committee'}
  },

  {
    path: '/account',
    name: 'account',
    component: () =>
      import(/* webpackChunkName: "account" */ '../../views/Account/Account.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/account/register',
    name: 'accountRegister',
    component: () =>
      import(/* webpackChunkName: "account" */ '../../views/Account/AccountRegister.vue'),
    meta: {requireAuth, showLayout, activeName: 'account'}
  },
  {
    path: '/account/edit/:id',
    name: 'accountEdit',
    component: () =>
      import(/* webpackChunkName: "account" */ '../../views/Account/AccountEdit.vue'),
    meta: {requireAuth, showLayout, activeName: 'account'}
  },
  {
    path: '/account/detail/:id',
    name: 'accountDetail',
    component: () =>
      import(/* webpackChunkName: "account" */ '../../views/Account/AccountDetail.vue'),
    meta: {requireAuth, showLayout, activeName: 'account'}
  },

  {
    path: '/member',
    name: 'member',
    component: () =>
      import(/* webpackChunkName: "member" */ '../../views/Member/Member.vue'),
    meta: {requireAuth, showLayout}
  },
  {
    path: '/memberAddEdit/:id?',
    name: 'memberAddEdit',
    alias: ['/member/add', '/member/edit/:id'],
    component: () =>
      import(/* webpackChunkName: "member" */ '../../views/Member/MemberAddEdit.vue'),
    meta: {requireAuth, showLayout, activeName: 'member'}
  },
  {
    path: '/memberDetail/:id',
    name: 'memberDetail',
    alias: ['/member/detail/:id'],
    component: () =>
      import(/* webpackChunkName: "member" */ '../../views/Member/MemberDetail.vue'),
    meta: {requireAuth, showLayout, activeName: 'member'}
  },
  {
    path: '/userinfo',
    name: 'userInfo',
    component: () =>
      import(/* webpackChunkName: "userInfo" */ '../../views/UserInfo.vue'),
    meta: {requireAuth, showLayout}
  }
]